﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Vitruvian.Serialization;
using Vitruvian.Logging;
using Vitruvian.Testing;

namespace SpotItComponents
{
    /// <summary>
    /// User Info object
    /// 
    /// A UserInfo object is a partial read-only copy of a user account object.  Although, the class includes setter properties, any
    /// changes to one of this objects will not have any impact on the corresponding user account object.  The changes will only affect
    /// the local object.  The setters are needed so the object can be created as a result of communications from the server.
    /// </summary>
    [ContainsTests("Components.UserStuff")]
    [OptimisticSerialization]
    public class UserInfo
    {
        public Guid Id { get; set; }
        public string Username { get; set; }
        public string FullName { get; set; }
        public bool IsDesigner { get; set; }
        public bool IsAdmin { get; set; }

        public UserInfo() { }

        public UserInfo(UserAccount account)
        {
            Id = account.Id;
            Username = account.Username;
            FullName = account.FullName;
            IsDesigner = account.IsDesigner;
            IsAdmin = account.IsAdmin;
        }

        public UserInfo(string playerName)
        {
            Id = Guid.Empty;
            Username = playerName;
            FullName = playerName;
            IsDesigner = false;
            IsAdmin = false;
        }

    }
}
